//
//  RegisterController.swift
//  NavigationControl
//
//  Created by ap0stader on 2023/11/21.
//

import UIKit

class RegisterViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
    }

    @IBOutlet var studentid: UITextField!
    
    @IBOutlet var password: UITextField!
    
    @IBAction func submit(_ sender: UIButton) {
        self.dismiss(animated: true) {
            () -> Void in
            let studentInfo = ["ID": self.studentid.text!, "password": self.password.text!]
            NotificationCenter.default.post(name: Notification.Name(rawValue: "RegisterSubmitNotification"), object: nil, userInfo: studentInfo)
        }
    }
    
    @IBAction func back(_ sender: UIButton) {
        self.dismiss(animated: true, completion: nil)
    }
    
    @IBAction func dismisskeyboard(_ sender: UITapGestureRecognizer) {
        studentid.resignFirstResponder()
        password.resignFirstResponder()
    }
    
}
